package com.generalbackend.role.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;

/**
* ClassName: PermissionRestApi
* @Description 接口权限表实体类
* @author tim.xie
* @date 2021-12-14 13:26
*/

@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@TableName("t_permission_rest_api")
public class PermissionRestApi  {
	/**
	 * 
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	@TableId(value = "id", type = IdType.ID_WORKER)
    private Long id;
	/**
	 * 菜单主键id
	 */
    @TableField("permission")
    private String permission;
	/**
	 * API主键id
	 */
    @TableField("api_id")
    private Long apiId;
	/**
	 * 创建时间
	 */
    @TableField("create_time")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
	/**
	 * 更新时间
	 */
    @TableField("gmt_modified")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date gmtModified;

    public PermissionRestApi(String permission, Long apiId) {
    	this.permission = permission;
    	this.apiId = apiId;
	}

}